<%@ page language="java" isELIgnored="false" import="java.util.*" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>没有航班信息Excel——恒拓运价魔方</title>
<%@ include file="/pages/common/header.jsp" %>

<script type="text/javascript" src="<%=request.getContextPath() %>/fare/js/show.js"></script>
<link href="<%=request.getContextPath() %>/fare/css/base.css" rel="stylesheet" type="text/css" /> 
<!-- 圆角文本框 -->
<link href="<%=request.getContextPath() %>/fare/css/htc/htc.css" rel="stylesheet" type="text/css" /> 
<script type="text/javascript" src="<%=request.getContextPath() %>/jsFile/js_new/jquery.1.7.2.js"></script>
 <script type="text/javascript" src="<%=request.getContextPath()%>/fare/js/json2.js"></script>
 <script src="<%=request.getContextPath()%>/fare/lib/jquery/jquery.form.js"	type="text/javascript"></script>
 <script type="text/javascript" src="<%=request.getContextPath()%>/jsFile/multiblepicker.js"></script>
 <link rev="stylesheet" media="all" href="<%=request.getContextPath() %>/fare/css/form_style.css" type="text/css" rel="stylesheet" />
 <script type="text/javascript" src="<%=request.getContextPath() %>/fare/lib/ligerUI/js/ligerui.min.js"></script>
 <script src="<%=request.getContextPath()%>/fare/js/datePicker/WdatePicker.js" type="text/javascript"></script>
<%-- <style type="text/css">
	.navbar{line-height:33px;height:33px;background:url('${pageContext.request.contextPath}/images/background/navbar.gif') repeat-x; width:100%; position:relative; margin-top:8px; margin-bottom:8px;}
		.navbar-l,.navbar-r{ width:2px;height:33px;background:url('${pageContext.request.contextPath}/images/background/navbar.gif') no-repeat; position:absolute; }
		.navbar-l{ left:0px; background-position:0px -33px;}
		.navbar-r{ right:0px;background-position:0px -66px;}
		.navbar-icon{ position:absolute; left:7px; top:6px;}
		.navbar img{ width:20px; height:20px;}
		.navbar-inner{ margin-left:30px;}
		.navbar a{ color:#3186C8;}
</style> --%>
<style type="text/css">
.tooltips{
text-decoration:none;
position:relative;
z-index:2;
}
.tooltips:hover{
z-index:3;
background:none;
}
.tooltips span{
display: none;
}
.tooltips:hover span{
z-index:99999;
display:block;
position:absolute;  
margin:-25px 0px 0px -25px; border:0;
clear:both;
overflow:hidden;
margin:0;
padding:0;
border:1px solid black;
background-color:#DCDCDC;
padding:3px;
color:black;
}
</style> 
<script type="text/javascript">


//下载报表
function doDownloadFile(path,fileSubject){
	var filePath=encodeURI(encodeURI(path));
	var subjectName=encodeURI(encodeURI(fileSubject));
	window.location.href="<%=request.getContextPath() %>/crawlNoFlightInfoLinesAction!download.action?filePaths="+filePath+"&subjectNames="+subjectName;
	
	
}

//查找报表
function find(){
	var grabDateStr=$("#grabDate").val();
	$("#dataForm").attr("action","<%=request.getContextPath()%>/crawlNoFlightInfoLinesAction!findByCondition.action?grabDateStr="+grabDateStr);
	$("#dataForm").submit();
}


function checkForm(){
	var grabDate =$('#grabDate').val();
	var flag=true;
	if(grabDate =='' || grabDate ==null || grabDate=='undefined'){
		flag=false;
		alert("请选择要生成报表！");
		return;
	}
	return flag;
}


//生成报表
function createReport(){
	if(checkForm()){
		if(	confirm("确定生成报表？")){
			$("#wait").show();
			$("#dataForm").ajaxSubmit({
				url:"<%=request.getContextPath()%>/crawlNoFlightInfoLinesAction!execute.action",
				type:'post',
		//		dataType:'json',
				cache : false,
			    async : false,
			    
			    beforeSend:function(){},
			    success:function(data){
			    	if(data=='SUCCESS'){
			    		alert("报表生成成功，后台将发送报表");
			    	}else{
			    		alert("报表生成失败！失败原因："+data);
			    		return ;
			    	}
			    	$("#btn1").removeAttr("disabled");
			    	$("#wait").hide();
			    	window.location.href="<%=request.getContextPath() %>/crawlNoFlightInfoLinesAction!toJSP.action";
			    },
			    error:function(){
			    	alert("报表生成错误！，请联系管理员！");
			    	$("#btn1").removeAttr("disabled");
			    	$("#wait").hide();
			    },
			    complete:function(){
			    	$("#btn1").removeAttr("disabled");
			    	$("#wait").hide();
			    }
			});
		}
	}
}

/* 清空 数据
 */
function clearcontent(){	
	$("#grabDate").val("");
}

</script>

</head>
<body>
<div class="searchtitle" style="width :1100px;">
<div class="sideBar">
	<div class="box">
		<div class="location">当前位置：抓取管理 &gt;没有航班信息报表</div>
	</div>
</div>
	<div class="navbar">
	<div class="navbar-l"></div>
	<div class="navbar-r"></div>
	<div class="navbar-inner"> <b>生成报表</b>	</div>
	<form method="post" id="dataForm"	action="">
	<table width="0" border="0" cellpadding="0" cellspacing="0" class="form_table">
		<tr>
			<td class="left" name="" id="">抓取日期:</td>
			<td >
				<input name="loginTimeStr" type="text"	id="grabDate" name="grabDate" onClick="WdatePicker({dateFmt:'yyyy-MM-dd',maxDate:'%y-%M-{%d-0}'})" readonly="readonly"/>
			</td>
			<td>
				<%-- <img src="<%=request.getContextPath() %>/fare/images/but_01.png" name="querybutton" id="querybutton" onclick="javascript:find();" />
				<img src="<%=request.getContextPath() %>/fare/images/but_02.png" name="btn1" id="btn1" onclick="javascript:createReport();" /> --%>
				<%-- <img src="<%=request.getContextPath() %>/fare/images/but_02.png" name="cancelbutton" id="cancelbutton" onclick="javascript:clearcontent();" /> --%>
				<input name="clearUser" type="button" class="btn-normal" value="查询" onclick="javascript:find();" style="margin-left:18px"/>
				<input name="clearUser" type="button" class="btn-normal" value="生成" onclick="javascript:createReport();" style="margin-left:18px"/>
				<input name="clearUser" type="button" class="btn-normal" value="清空" onclick="javascript:clearcontent();" style="margin-left:18px"/> 
			</td>
		</tr>
	</table>
	</form>
	
	<div id="wait" style="display:none; text-align:center;" >
		<span ><font color="red"> 正在操作中，请耐心等待...</font></span>
	</div>
		<div class="high_10"></div>
		<div class="navbar">
			<div class="navbar-l"></div>
			<div class="navbar-r"></div>
				<div class="navbar-inner"> 
				<b>下载报表</b> 
				</div>
				<div class="form_down" id="">
					 <c:if test="${not empty listVos }">
						<c:forEach items="${listVos}" var="vos" varStatus="status">
							 <ul class="" onMouseOver="this.className='org'" onMouseOut="this.className='one'" ">
								 <li>
									 <a  class="tooltips" id="feed_id" onclick="doDownloadFile('${vos.path}','${vos.title}');">${vos.title} 
									<span><font size="2" style="line-height:12pt;padding:33px 0 0;white-space:nowrap;" >生成时间：${vos.createTime }<br/>
							
									</font>
									</a>&nbsp;&nbsp;&nbsp;
								 </li>
							</ul>
						</c:forEach> 
					</c:if>
					

					</div>
					
	
		<%-- <div class="list_page" style="height: 30px;">
			<jsp:include page="/fare/manualTriggerReport/pageComponent.jsp"></jsp:include>
		</div> --%>
	</div>
	
</div>

</body>
</html>
